﻿using HomagChina.CCT.DataTypeModel;
using HomagGroup.Base.UI;
using HomagGroup.Base.UI.Themes.Resources;
using HomagChina.CCT.ViewModels;
using System.Collections.ObjectModel;
using static HomagChina.CCT.ProcessResourceInternal;
using static HomagChina.CCT.Utility;
using Application = System.Windows.Application;

namespace HomagChina.CCT.Router
{
    public class IntelligencePlatformRoute
    {
        public RouterItemDataModel IntelligencePlatformRouteModel { get; set; }

        public IntelligencePlatformRoute()
        {
            var model = new IntelligencePlatformViewModel();
            IntelligencePlatformRouteModel = new RouterItemDataModel()
            {
                ID = "IntelligencePlatform",
                viewLabel = GetLocaText("IntelligencePlatform"),
                viewName = "IntelligencePlatform",
                keepalive = false,
                viewModelName = "IntelligencePlatformViewModel",
                ViewModel = model,
                userControl = GetUserControlInstance("IntelligencePlatform"),
                Image = null,
                functionKeyBarItems = new ObservableCollection<FunctionKeyBarItemDataModel>
                {
                    new FunctionKeyBarItemDataModel() {
                        Header =GetLocaText("Exit"),
                        Position = 12,
                        Icon = GetIconBrush(Icon.Close,ImageDecoration.Circle),
                        Command = new RelayCommand(() => { Application.Current.Shutdown(); })
                    },
                    new FunctionKeyBarItemDataModel(){
                        Header =GetLocaText("Save Project"),
                        Position = 10,
                        Icon = GetIconBrush(Icon.ViewComfy,overlayIcon:OverlayIcon.Save),
                        Command= new RelayCommand(model.HandleSaveProject)
                    },
                    new FunctionKeyBarItemDataModel(){
                        Header=GetLocaText("Clear"),
                        Position=9,
                         Icon = GetIconBrush(Icon.Selection,overlayIcon:OverlayIcon.Delete),
                        Command= new RelayCommand(model.HandleClear)
                    },
                    new FunctionKeyBarItemDataModel(){
                        Header =GetLocaText("Export ExcelFile"),
                        Position = 8,
                        Icon = GetIconBrush(Icon.File,overlayIcon:OverlayIcon.Database),
                        Command= new RelayCommand(model.ExportExcelFile)
                    },
                }
            };
            IntelligencePlatformRouteModel.userControl.DataContext = model;
        }
    }
}